var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, n, o) {
    var r, a = arguments.length, c = a < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, n, o); else for (var u = t.length - 1; 0 <= u; u--) (r = t[u]) && (c = (a < 3 ? r(c) : 3 < a ? r(e, n, c) : r(e, n)) || c);
    return 3 < a && c && Object.defineProperty(e, n, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("Global"), s = e("AuthManager"), c = e("GameConfig"), l = e("WebManager"), d = e("UIManager"), u = cc._decorator, p = u.ccclass, h = u.property, f = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.auth = null, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        var e = this;
        l.default.getInstance().reqGetUserAuth({
            success: function(t) {
                0 == t.data.code && (r.G.age = t.data.data.age, s.default.getInstance().isAuth = 18 <= r.G.age), 
                e.auth.active = !0, 0 < r.G.age ? e.node.active = !1 : (cc.systemEvent.on("finishAuth", function() {
                    e.node.active = !1;
                }), e.refresh() && c.GC.authFirst && d.default.getInstance().loadPnl("auth"));
            }
        });
    }, t.prototype.onEnable = function() {
        this.refresh();
    }, t.prototype.onClickAuth = function() {
        l.default.getInstance().sentLog("点击首页防沉迷按键"), d.default.getInstance().loadPnl("auth");
    }, t.prototype.start = function() {}, t.prototype.refresh = function() {
        return !(this.auth.active && !s.default.getInstance().doCheck() && (d.default.getInstance().loadPnl("auth"), 
        1));
    }, a([ h(cc.Node) ], t.prototype, "auth", void 0), a([ p ], t);
}(cc.Component);

n.default = f;